package www.wxwnb.clerk.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;


/**
 * Created by lenovo on 2017/9/9.
 */

public class MyViewPagerAdapter extends FragmentPagerAdapter {
    List<Fragment> list;
    List<String> list_title;
    public MyViewPagerAdapter(FragmentManager fm, List<Fragment> list, List<String> list_title) {
        super(fm);
        this.list=list;
        this.list_title=list_title;
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list==null?0:list.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return list_title.get(position);
    }
}
